import request from '@/config/axios'

export interface ActivitiesVO {
  id: number
  name: string
  rules: string
  state: string
  bgImage: string
}

// 查询活动分页
export const getActivitiesPage = async (params) => {
  return await request.get({ url: `/gd/activities/page`, params })
}

// 查询活动详情
export const getActivities = async (id: number) => {
  return await request.get({ url: `/gd/activities/get?id=` + id })
}

// 新增活动
export const createActivities = async (data: ActivitiesVO) => {
  return await request.post({ url: `/gd/activities/create`, data })
}

// 修改活动
export const updateActivities = async (data: ActivitiesVO) => {
  return await request.put({ url: `/gd/activities/update`, data })
}

// 删除活动
export const deleteActivities = async (id: number) => {
  return await request.delete({ url: `/gd/activities/delete?id=` + id })
}

// 导出活动 Excel
export const exportActivities = async (params) => {
  return await request.download({ url: `/gd/activities/export-excel`, params })
}